:root {
  /* 莫奈调色板 */
  --primary-color: #4E7D96; /* 莫奈蓝 */
  --secondary-color: #E6A57A; /* 暖橙色 */
  --accent-color: #9CB4CC; /* 淡蓝灰 */
  --bg-color: #F5F7FA; /* 淡灰背景 */
  --text-color: #2C3E50; /* 深蓝灰文字 */
  --border-color: #E8ECF2; /* 淡边框 */
  --hover-color: #EEF2F7; /* 悬停背景 */
  --success-color: #68A691; /* 莫奈绿 */
  --error-color: #C15B5B; /* 暖红色 */
  --modal-bg: rgba(44, 62, 80, 0.6); /* 半透明深色 */
  
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(44, 62, 80, 0.08);
  --shadow-md: 0 4px 8px rgba(44, 62, 80, 0.12);
  --shadow-lg: 0 8px 16px rgba(44, 62, 80, 0.16);
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* 动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
}

.container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* 左侧面板 */
.left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: #fff;
  min-width: 300px;
}

/* 右侧面板 */
.right {
  width: 250px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

/* 用户列表头部 */
.users-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.users-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.user-count {
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

/* 聊天区域 */
.chat-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

/* 欢迎信息 */
.welcome-message {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.welcome-header svg {
  color: var(--primary-color);
}

.welcome-header h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.welcome-desc {
  margin-bottom: 30px;
}

.welcome-desc > p {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.feature-item {
  padding: 20px;
  background: var(--bg-color);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-item svg {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.feature-item span {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
}

.feature-item p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.welcome-footer {
  text-align: right;
  margin-top: 20px;
}

.welcome-footer .tip {
  color: #666;
  font-size: 14px;
  font-style: italic;
}

/* 工具栏 */
.toolbar {
  padding: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  background: #fff;
}

.toolbar-left, .toolbar-right {
  display: flex;
  gap: 10px;
}

.toolbar-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  color: #666;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: var(--hover-color);
  color: var(--primary-color);
}

/* 录音按钮动画 */
.toolbar-btn.recording {
  animation: pulse 1s infinite;
  background: var(--error-color);
  color: white;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 输入框 */
.input-wrapper {
  border-top: 1px solid var(--border-color);
  padding: 10px;
  background: #fff;
}

.txt-msg {
  width: 100%;
  height: 80px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: none;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.txt-msg:focus {
  border-color: var(--primary-color);
}

/* 用户列表 */
#users {
  list-style: none;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

#users li {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 5px;
  background: var(--bg-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

#users li:hover {
  background: var(--hover-color);
  transform: translateX(5px);
}

/* 消息样式 */
.message {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.self {
  align-items: flex-end;
  margin-left: auto;
}

.message-header {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

.message-content {
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--bg-color);
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.self .message-content {
  background: var(--primary-color);
  color: white;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-bg);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal h3 {
  margin-bottom: 20px;
  color: var(--text-color);
}

/* 文件信息预览 */
.file-info-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-color);
  border-radius: 8px;
  margin: 15px 0;
}

.file-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  font-size: 24px;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.file-size, .file-from {
  font-size: 12px;
  color: #666;
}

/* 进度条 */
.progress-container {
  margin: 15px 0;
  display: none;
}

.progress-text {
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.progress-bar {
  height: 4px;
  background: var(--bg-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--primary-color);
  width: 0;
  transition: width 0.3s ease;
}

/* 按钮样式 */
.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-footer button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: var(--bg-color);
  color: var(--text-color);
}

.confirm-btn {
  background: var(--primary-color);
  color: white;
}

.cancel-btn:hover {
  background: #e5e5e5;
}

.confirm-btn:hover {
  background: #0056b3;
}

/* 拖拽提示 */
.dragtip {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-bg);
  z-index: 1000;
  color: white;
}

.dragtip-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.dragtip.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

/* 输入框容器 */
.nickname-input-container,
.password-input-container {
  margin-bottom: 20px;
}

.nickname-input-container input,
.password-input-container input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  font-size: 14px;
}

.nickname-input-container input:focus,
.password-input-container input:focus {
  border-color: var(--primary-color);
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 移动端适配 */
.mobile-only {
  display: none;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  .container {
    position: relative;
  }

  .right {
    position: fixed;
    right: -250px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(0);
  }

  .right.active {
    transform: translateX(-250px);
  }

  .mobile-only {
    display: block;
  }

  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-bg);
    z-index: 99;
  }

  .mobile-overlay.active {
    display: block;
  }

  .modal-content {
    width: 90%;
  }

  .message {
    max-width: 90%;
  }

  .txt-msg {
    height: 60px;
  }

  .welcome-message {
    padding: 20px;
  }

  .welcome-header h2 {
    font-size: 24px;
  }

  .feature-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .feature-item {
    padding: 15px;
  }

  .welcome-footer .tip {
    display: none;
  }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --border-color: #333;
    --hover-color: #2a2a2a;
  }

  body {
    background: #000;
  }

  .left, .right {
    background: #1a1a1a;
  }

  .welcome-message {
    background: var(--bg-color);
  }

  .toolbar, .input-wrapper {
    background: #1a1a1a;
  }

  .modal-content {
    background: #1a1a1a;
  }

  .file-icon {
    background: #2a2a2a;
  }

  .feature-item {
    background: #2a2a2a;
  }

  .feature-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* 代码输入模态框 */
.code-input-container {
  margin-bottom: 20px;
}

.language-select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
}

.code-input {
  width: 100%;
  min-height: 200px;
  padding: 10px;
  font-family: monospace;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  resize: vertical;
}

/* 代码块样式 */
.code-block {
  background: var(--bg-color);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.05);
}

.code-language {
  font-size: 12px;
  color: #666;
}

.copy-btn {
  border: none;
  background: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.code-block pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
}

.code-block code {
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
  .code-block {
    background: #2a2a2a;
  }
  
  .code-header {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .code-language {
    color: #999;
  }
  
  .language-select,
  .code-input {
    background: #2a2a2a;
    color: #fff;
  }
}

/* 截图提示 */
.screenshot-tip {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 2000;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translate(-50%, -100%); }
  to { transform: translate(-50%, 0); }
}

/* 语音录制动画 */
.voice-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--error-color);
  border-radius: 50%;
  animation: ripple 1s infinite;
}

@keyframes ripple {
  0% {
    width: 10px;
    height: 10px;
    opacity: 1;
  }
  100% {
    width: 30px;
    height: 30px;
    opacity: 0;
  }
}

/* 代码消息样式 */
.code-message {
  max-width: 100% !important;
  margin: 10px 0;
}

.code-message .code-block {
  background: var(--bg-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.code-message .code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--border-color);
}

.code-message .code-language {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
}

.code-message .copy-btn {
  border: none;
  background: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.code-message .copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.code-message .copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.code-message pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  background: var(--bg-color);
}

.code-message code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color);
}

/* 语音消息样式 */
.voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.voice-message .voice-icon {
  color: var(--primary-color);
  animation: pulse 1s infinite;
}

.voice-message .voice-duration {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
  .code-message .code-block {
    background: #2a2a2a;
  }
  
  .code-message .code-header {
    background: rgba(255, 255, 255, 0.05);
    border-color: #333;
  }
  
  .code-message pre {
    background: #2a2a2a;
  }
  
  .code-message code {
    color: #fff;
  }
  
  .voice-message {
    background: #2a2a2a;
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .code-message pre {
    max-width: calc(100vw - 40px);
  }
  
  .voice-message {
    max-width: calc(100vw - 40px);
  }
} 